/*   1:    */ package com.rinsi.app.azsb.azzl.jbzl.azmcxx;
/*   2:    */ 
/*   3:    */ import com.rinsi.core.CoreCache;
/*   4:    */ import com.rinsi.core.service.CoreSimpleService;
/*   5:    */ import com.rinsi.util.AssertUtil;
/*   6:    */ import com.rinsi.util.ListUtil;
/*   7:    */ import com.rinsi.util.MapUtil;
/*   8:    */ import java.util.List;
/*   9:    */ import java.util.Map;
/*  10:    */ import org.mybatis.spring.SqlSessionTemplate;
/*  11:    */ import org.springframework.stereotype.Service;
/*  12:    */ 
/*  13:    */ @Service
/*  14:    */ public class AzmcxxService
/*  15:    */   extends CoreSimpleService
/*  16:    */ {
/*  17:    */   public void afterIndex(Map<String, Object> model, Map<String, Object> rMap)
/*  18:    */   {
/*  19: 21 */     rMap.put("mzs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400009)));
/*  20:    */     
/*  21: 23 */     rMap.put("cmfss", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400010)));
/*  22:    */     
/*  23: 25 */     rMap.put("wsdjs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400011)));
/*  24:    */     
/*  25: 27 */     rMap.put("cjdys", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400012)));
/*  26:    */     
/*  27: 29 */     rMap.put("mcbzwhxs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400013)));
/*  28:    */     
/*  29: 31 */     rMap.put("mczrqxxs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400014)));
/*  30:    */     
/*  31: 33 */     rMap.put("shlxs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400015)));
/*  32:    */     
/*  33: 35 */     rMap.put("kjswdzs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400016)));
/*  34:    */     
/*  35: 37 */     Map<String, Object> params = getParams(model);
/*  36:    */     
/*  37:    */ 
/*  38: 40 */     List<Map<String, Object>> modules = CoreCache.getCacheList(MapUtil.getString(params, "UID"), "modules");
/*  39:    */     
/*  40: 42 */     List<Map<String, Object>> sub_rights = ListUtil.subList(modules, "MODULE_NO_PRE='500001'");
/*  41:    */     
/*  42: 44 */     rMap.put("azsbxx", getSqlSessionTemplate().selectOne("azsb.get", params));
/*  43:    */     
/*  44: 46 */     rMap.put("userxx", CoreCache.getCacheMap(MapUtil.getString(params, "UID"), "user"));
/*  45:    */     
/*  46: 48 */     model.put("sub_rights", ListUtil.listToMap(sub_rights, "MODULE_TYPE"));
/*  47:    */   }
/*  48:    */   
/*  49:    */   public Map<String, Object> listlt(Map<String, Object> model)
/*  50:    */   {
/*  51: 61 */     Map<String, Object> params = getParams(model);
/*  52:    */     
/*  53: 63 */     Map<String, Object> config = getConfig(model);
/*  54:    */     
/*  55: 65 */     Map<String, Object> rMap = getRMap();
/*  56:    */     try
/*  57:    */     {
/*  58: 69 */       beforeList(model);
/*  59:    */       
/*  60: 71 */       Integer page = MapUtil.getInteger(params, "page");
/*  61:    */       
/*  62: 73 */       Integer rows = MapUtil.getInteger(params, "rows");
/*  63:    */       
/*  64: 75 */       List<Map<String, Object>> datas = getSqlSessionTemplate().selectList(namespace(config) + ".listlt", params);
/*  65: 77 */       if ((MapUtil.getInteger(config, "module.page") != null) && (MapUtil.getInteger(config, "module.page").intValue() == 1)) {
/*  66: 79 */         if (AssertUtil.isCollectionNotEmpty(datas))
/*  67:    */         {
/*  68: 81 */           rMap.put("total", Integer.valueOf(datas.size()));
/*  69:    */           
/*  70: 83 */           Integer begin = Integer.valueOf((page.intValue() - 1) * rows.intValue());
/*  71:    */           
/*  72: 85 */           Integer end = Integer.valueOf(page.intValue() * rows.intValue());
/*  73: 87 */           if (end.intValue() > datas.size()) {
/*  74: 89 */             end = Integer.valueOf(datas.size());
/*  75:    */           }
/*  76: 92 */           datas = datas.subList(begin.intValue(), end.intValue());
/*  77:    */         }
/*  78:    */         else
/*  79:    */         {
/*  80: 96 */           rMap.put("total", Integer.valueOf(0));
/*  81:    */         }
/*  82:    */       }
/*  83:100 */       rMap.put("datas", datas);
/*  84:    */     }
/*  85:    */     catch (Exception ex)
/*  86:    */     {
/*  87:104 */       rMap.put("success", Boolean.valueOf(false));
/*  88:106 */       if (MapUtil.getBoolean(rMap, "shoeExMessage").booleanValue()) {
/*  89:108 */         rMap.put("message", ex.getMessage());
/*  90:    */       } else {
/*  91:112 */         rMap.put("message", "展示数据列表出错！请稍后重试，或联系系统管理员！");
/*  92:    */       }
/*  93:115 */       rMap.put("ex", ex.getMessage());
/*  94:    */       
/*  95:117 */       ex.printStackTrace();
/*  96:    */     }
/*  97:120 */     afterList(model, rMap);
/*  98:    */     
/*  99:122 */     return rMap;
/* 100:    */   }
/* 101:    */   
/* 102:    */   public Map<String, Object> listkc(Map<String, Object> model)
/* 103:    */   {
/* 104:135 */     Map<String, Object> params = getParams(model);
/* 105:    */     
/* 106:137 */     Map<String, Object> config = getConfig(model);
/* 107:    */     
/* 108:139 */     Map<String, Object> rMap = getRMap();
/* 109:    */     try
/* 110:    */     {
/* 111:143 */       beforeList(model);
/* 112:    */       
/* 113:145 */       Integer page = MapUtil.getInteger(params, "page");
/* 114:    */       
/* 115:147 */       Integer rows = MapUtil.getInteger(params, "rows");
/* 116:    */       
/* 117:149 */       List<Map<String, Object>> datas = getSqlSessionTemplate().selectList(namespace(config) + ".listkc", params);
/* 118:151 */       if ((MapUtil.getInteger(config, "module.page") != null) && (MapUtil.getInteger(config, "module.page").intValue() == 1)) {
/* 119:153 */         if (AssertUtil.isCollectionNotEmpty(datas))
/* 120:    */         {
/* 121:155 */           rMap.put("total", Integer.valueOf(datas.size()));
/* 122:    */           
/* 123:157 */           Integer begin = Integer.valueOf((page.intValue() - 1) * rows.intValue());
/* 124:    */           
/* 125:159 */           Integer end = Integer.valueOf(page.intValue() * rows.intValue());
/* 126:161 */           if (end.intValue() > datas.size()) {
/* 127:163 */             end = Integer.valueOf(datas.size());
/* 128:    */           }
/* 129:166 */           datas = datas.subList(begin.intValue(), end.intValue());
/* 130:    */         }
/* 131:    */         else
/* 132:    */         {
/* 133:170 */           rMap.put("total", Integer.valueOf(0));
/* 134:    */         }
/* 135:    */       }
/* 136:174 */       rMap.put("datas", datas);
/* 137:    */     }
/* 138:    */     catch (Exception ex)
/* 139:    */     {
/* 140:178 */       rMap.put("success", Boolean.valueOf(false));
/* 141:180 */       if (MapUtil.getBoolean(rMap, "shoeExMessage").booleanValue()) {
/* 142:182 */         rMap.put("message", ex.getMessage());
/* 143:    */       } else {
/* 144:186 */         rMap.put("message", "展示数据列表出错！请稍后重试，或联系系统管理员！");
/* 145:    */       }
/* 146:189 */       rMap.put("ex", ex.getMessage());
/* 147:    */       
/* 148:191 */       ex.printStackTrace();
/* 149:    */     }
/* 150:194 */     afterList(model, rMap);
/* 151:    */     
/* 152:196 */     return rMap;
/* 153:    */   }
/* 154:    */ }


/* Location:           D:\Users\Desktop\shanxi\项目\sxazmis\WEB-INF\classes\
 * Qualified Name:     com.rinsi.app.azsb.azzl.jbzl.azmcxx.AzmcxxService
 * JD-Core Version:    0.7.0.1
 */